<include file="Public:header" />
<link rel="stylesheet" type="text/css" href="../Public/css/book.css"/>
<link href="../Public/css/downappear.css" rel="stylesheet" type="text/css" />
<SCRIPT LANGUAGE=JavaScript>
<!--
function getLight(pars)
{	
	//alert("播放器模式参数值："+string+"");
	if(pars == "open")
	{
		close_light(this);
	}
	else
	{
		close_light(this);
	}
}


//兼容性
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

//-->
</SCRIPT> 
<div class="content">
<div class="crumbs">当前位置：<a href="{:U('Game/index')}">游戏</a> ><if condition="$erjicate neq ''"> <a href="{:U('Game/index',array('cateid'=>$game['erjicate'],erji=>1))}">{$erjicate} ></a></if><if condition="$cate neq ''">> <a href="{:U('Game/index',array('cateid'=>$game['cateid']))}">{$cate} ></a></if>  {$game.title} </div>
<div class="w_content">
<div class="content_l">
	<div class="innerthr">
    	<div class="titleth">
        	<h1 style="position:relative"><img style="padding-right:10px; position:absolute; top:7px; left:13px;" src="../Public/images/tubiao_game.png" alt="" title="">{$game.title}</h1>
            <table border="0" cellspacing="0" cellpadding="0" >
            	<tr>
                	<td>游戏编号: <span>{$game.code}</span></td>
                    <td>所需积分: <span>{$game.downscore}</span></td>
                    <td>下载次数: <span>{$game.point}次</span></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                	<td>上传用户: <span>{$game.nickname}</span></td>
                    <td>上传日期: <span>{$game.uploadtime|date="Y-m-d H:i",###}</span></td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </div>
    </div>
    
    <div class="sicont">
    
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="736" height="520">
<param name="autostart" value="-1" />
<param name="wmode" value="transparent"> 
<param name="url" value="__PUBLIC__/Uploads/Game/{$game.url}" />
<embed src="__PUBLIC__/Uploads/Game/{$game.url}" wmode="transparent" autostart="0" type="video/x-ms-wmv" width="736" height="520">
</embed>
</object>    

    </div>  
    <a href="__PUBLIC__/zhuanhuan/kongjian.exe">如果不能播放请点击这里下载控件</a> 
   	<div class="clear"></div> 
    
    <div class="usebutt">
    	<ul>
    	<eq name='is_login' value='1'>
    	<li><a href="#aa"><img src="../Public/images/download_btn.jpg" alt="" title="" id='but' onclick="point({$game['downscore']},{$prescore})"></a></li>
         <li><img src="../Public/images/collect_btn.jpg" alt="" title="" onclick="favorite();"></li>
         <else/>
        <li><img src="../Public/images/download_btn.jpg" alt="" title="" id='but_no'></li>
        <li><img src="../Public/images/collect_btn.jpg" alt="" title="" id='no_login'></li>
        </eq>
        </ul>
        <DIV class=bshare-custom><A class=bshare-qzone title=分享到QQ空间></A><A class=bshare-sinaminiblog title=分享到新浪微博></A><A class=bshare-renren title=分享到人人网></A><A class=bshare-qqmb title=分享到腾讯微博></A><A class=bshare-douban title=分享到豆瓣></A><A class="bshare-more bshare-more-icon more-style-addthis" title=更多平台></A></DIV>
<SCRIPT type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=2&amp;lang=zh"></SCRIPT>

<SCRIPT type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></SCRIPT>
    </div>
    <a a name="aa" id="aa"></a>
<div class="detail">
	<p class="dtitle">简介</p>
	<p class="dpage">
	{$game.desc}
	</p>
</div>      
    
<div class="detail">
<p class="dtitle">会员评论（{$count}）</p>
<p class="dpage">

<ul>
<volist id="cm" name="list">
<li class="friend_list">
<dl>
<dt>
<img src="__PUBLIC__/Uploads/PersonImage/{$cm.image}" />
<p>{$cm.nickname}</p>
</dt>
<dd>
<ul class="details_list">
<li><span class="time">发表于{$cm.comtime|date="Y-m-d H:i:s",###}</span></li>
<li><p>{$cm.comcontent}</p></li>
</ul>
</dd>
</dl>
</li>
</volist>
</ul>
<div class="num">
{$page_com}
</div>
</div>	
<div class="clear"></div>
<div class="comment">
<p><img src="../Public/images/comment_img.jpg" />我要点评</p>
<textarea name="comcontent" id="fbcomment" onkeyup="limitLength(this,100)" style="width:730px; height:79px;margin: 5px 0;"></textarea>
<p style="color:#666;font-size:12px;font-weight: normal;">最多评论100字</p>
<a href="javascript:void(0);" onclick="fbcomment('4','{$game.gid}','{$game.title}')"><span class="send_btn">发送</span></a>
</div>
</div>
<div class="content_r">
<div class="upload"><input type="button" class="upload_bt" onclick="window.location.href='{:U('Game/upload')}'" /></div>
<div class="related">
<div class="rel_t"><h3>相关游戏</h3>
<span><a href="#"></a></span>

</div>
<div class="rel_c">
<if condition="$xsta eq 0">
<p style="text-align:center; height:20px; line-height:20px;font-size:14px;color:#666;">暂无相关游戏</p>
<else />
<volist id="xvo" name="xlist">
<h1 class="lflist"><img src="../Public/images/tubiao_game.png" alt="" title=""><a href="{:U('Game/info',array('vid'=>$xvo['gid']))}">{$xvo.title|msubstr=0,12}</a></h1>
</volist>
</if>
</div>



</div>
<div class="related">
<div class="rel_t"><h3>热门游戏</h3>
<span><a href="#"></a></span>

</div>
<div class="rel_c">
<if condition="$rsta eq 0">
<p style="text-align:center; height:20px; line-height:20px;font-size:14px;color:#666;">暂无热门游戏</p>
<else />
<volist id="rvo" name="rlist">
<h1 class="lflist"><img src="../Public/images/tubiao_game.png" alt="" title=""><a href="{:U('Game/info',array('vid'=>$rvo['gid']))}">{$rvo.title|msubstr=0,12}</a></h1>
</volist>
</if>
</div>
</div>

</div>
<div class="clear"></div>
</div>


<div class="dialog popups" style="z-index:1000;">
<p class="ph1">文件下载</p>
<h4>{$game.title}</h4>
<p class="needinfo">下载所需积分：<span class="integral" >{$game.downscore}</span></p>
<p class="restinfo">您所剩余积分：<span class="integral" id='prescore' id='prescore'>{$prescore}</span></p>
<div class="btn">
<form method='post' id='fom' action="{:U('Game/gamedownload')}">
           <input type='hidden' name='title' value='{$game.title}'/>
           <input type='hidden' name='url' value='{$game.url}'/>
          <input type='hidden' name='score' value='{$game.downscore}'/>
          <input type='hidden' name='code' value='{$game.code}'/>
          <input type='hidden' name='gid' value='{$game.gid}'/>
          <input type="button" value="立即下载" class="dbtn" id='down'  />
          <input type="button" value="取 消"  class="cbtn" id='cancel' onclick="disp('.dialog');"/>
          <input type='hidden' value='1' name='once' id='once'/>
          <input type='hidden' value='{$prescore}' name='prescore'/>
          <input type='hidden' value='0' name='count' id='count'/>
</form>
</div>
<p class="tips">如果您的积分不够，请及时<span><a href="{:U('Article/banquan',array('arid'=>4))}" target="blank">联系管理员</a></span></p>
</div>


<div class="popups dialog_fail" style="z-index:1000;">
<p class="ph1">文件下载</p>
<h4>{$game.title}</h4>
<p class="needinfo">下载所需积分：<span class="integral">{$game.downscore}</span></p>
<p class="restinfo">您所剩余积分：<span class="integral" id='prescore'>{$prescore}，不足以支付下载</span></p>
<div class="btn">
<!-- <input type="button" value="立即下载" class="nodbtn" id='free'/>-->
<input type="button" value="取 消"  class="cbtn" id='cancel' onclick="disp('.dialog_fail');"/>
</div>
<p class="tips">如果您的积分不够，请及时<span><a href="{:U('Article/banquan',array('arid'=>4))}" target="blank">联系管理员</a></span></p>
</div>
<script language="JavaScript">
var k=0;
	function fbcomment(comtype,commid,commname){
		var comcontent = $("#fbcomment").val();
		if(comcontent == ""){
			alert("请输入评论");
			return false;
		}
		var comtype = comtype;
		var commid = commid;
		var commname = commname;
		$.post("{:U('Game/fbcomment')}", {comcontent:comcontent,comtype:comtype,commid:commid,commname:commname}, function(res){
			if(res){
				alert(res);
				$("#fbcomment").val("");
			}else{
				alert('评论失败');
				$("#fbcomment").val("");
			}
			
		});
	}
	
	function disp(res){ 
		   $(res).hide();
		   removeObj();
	   }
	   
	   function point(a,b){
		   suoding();
		   if(b>=a){
				 //var left=($(window).width()-$('.dialog').width())/2;
				// var top=($(window).height()-$('.dialog').height())/2;
				 $('.dialog').fadeIn().css({'top':1160,'left':478});
			}
			 if(b<a){
				// var left=($(window).width()-$('.dialog_fail').width())/2;
				// var top=($(window).height()-$('.dialog_fail').height())/2;
				 $('.dialog_fail').fadeIn().css({'top':1160,'left':478});
			}
	   }
	    $('#but_no').click(function(){
	    	 window.location.href="{:U('User/login',array('type'=>'Game','vid'=>$game['gid']))}";
    });
	    
	    $('#no_login').click(function(){
	    	 window.location.href="{:U('User/login',array('type'=>'Game','vid'=>$game['gid']))}";
		 });
	    var p=1;
	    $('#down').click(function(){
	          var vall=$('#once').val(); var valen=parseInt(vall)+1; 
	          var downlow="{$game.downscore}"; var pre="{$prescore}";
		        	$("#once").attr("value",valen);
		        	var newval=parseInt(pre)-parseInt(downlow);
		        	$("#prescore").html(newval);
			        $('.dialog').hide();
			        $('#count').val(k);
			        $('#once').val(p);
			        p+=1;
			        removeObj();
			        $('#fom').submit();
		 });
		
	    function favorite()
		{
			var vid="{$game.gid}";
			var type=4;
			var name="{$game.title}";
			$.post("{:U('Picture/favorite')}",{vid:vid,type:type,name:name},function (data){alert(data);} )
		}
	    function limitLength(obj, length) {   
	        var desc = obj.value;    
	        obj.value = substr(obj.value,length);   
	    }   
	    function substr(str,length){   
	        var l=0,i=0;   
	        while(l <length && i<str.length){   
	            l+=1;   
	           // if(str.substring(i,i+1).match(/[\u4e00-\u9fa5]/))l+=2;//一个中文是相当于3个英文   
	            i+=1;   
	        }   
	        return str.substring(0,i);   
	    }


	  //置灰页面，锁定页面
	    function suoding()
	    {
	    	sWidth=document.body.offsetWidth;//浏览器工作区域内页面宽度 或使用 screen.width//屏幕的宽度
	    	sHeight=$(document).height();//屏幕高度（垂直分辨率）
	    	//背景层（大小与窗口有效区域相同，即当弹出对话框时，背景显示为放射状透明灰色）
	    	var bgObj=document.createElement("div");//创建一个div对象（背景层） //动态创建元素，这里创建的是 div
	    	//定义div属性，即相当于(相当于，但确不是，必须对对象属性进行定义
	    	//<div id="bgDiv" style="position:absolute; top:0; background-color:#777; filter:progid:DXImagesTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75); opacity:0.6; left:0; width:918px; height:768px; z-index:10000;"></div>
	    	bgObj.setAttribute('id','bgDiv');
	    	bgObj.style.position="absolute";
	    	bgObj.style.top="0";
	    	bgObj.style.background="#777";
	    	bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
	    	bgObj.style.opacity="0.6";
	    	bgObj.style.left="0";
	    	bgObj.style.width=sWidth + "px";
	    	bgObj.style.height=sHeight + "px";
	    	bgObj.style.zIndex = "20";
	    	document.body.appendChild(bgObj);//在body内添加该div对象
		}
	    
		//点击取消按钮去除锁定效果
	    function removeObj()
	    {
	        document.body.removeChild(bgDiv);//删除背景层Div
	        //document.getElementById("msgDiv").removeChild(title);//删除提示框的标题栏
	        //document.body.removeChild(msgObj);//删除提示框层
	    }
</script>

<include file="Public:footer" />
